Skip to content

Log agent auth fails fail2ban friendly - #7601

Merged
6543 merged 5 commits into
woodpecker-ci:mainfrom
6543-forks:be-fail2ban-frendly
Nov 21, 2026
Merged

6543 merged 5 commits into
woodpecker-ci:mainfrom
6543-forks:be-fail2ban-frendly

Conversation

@6543

@6543 6543 commented Nov 19, 2026

Copy link
Copy Markdown
Member

Make it easy to ban IPs that try to brute-force agent tokens.

Write a fixed log line with the address of the client for every failed
agent login, so tools like fail2ban can block clients that guess agent
tokens. Behind a proxy the addresses from the X-Real-IP and
X-Forwarded-For headers are added, only if they are valid addresses, so
a client cannot write its own text into the line. The token is not
logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qcZ1ktsVkUYXuNWeLQtsR
Show the fail2ban filters for failed agent logins, direct and behind a
proxy, and jails for the journal, a log file and Docker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qcZ1ktsVkUYXuNWeLQtsR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qcZ1ktsVkUYXuNWeLQtsR
@woodpecker-bot

woodpecker-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Surge PR preview deployment was removed

@6543
6543 requested a review from a team November 20, 2026 00:21
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.92%. Comparing base (a3fb353) to head (78b0340).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7601      +/-   ##
==========================================
+ Coverage   66.87%   66.92%   +0.04%     
==========================================
  Files         451      451              
  Lines       22646    22668      +22     
==========================================
+ Hits        15145    15170      +25     
+ Misses       7501     7498       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qwerty287 qwerty287 changed the title Log agent auth fails fail2ban frendly Log agent auth fails fail2ban friendly Nov 20, 2026
@qwerty287

Copy link
Copy Markdown
Contributor

We probably cannot use the zerolog fields for structured logging, right? Cause that would be the cleaner way of logging but probably regex doesn't work anymore

@6543

6543 commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

@qwerty287 well ... fail2ban uses json internaly but for logs only regex is supported ... so no it does not help in fail2ban case ... else that would be quite usefull ...

@6543
6543 merged commit 98bc123 into woodpecker-ci:main Nov 21, 2026
9 checks passed
@6543
6543 deleted the be-fail2ban-frendly branch November 21, 2026 10:41
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 21, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants